<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/enterprise/enterpriseMember/enterpriseMember.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>企业会员</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>新增企业子会员</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">新增企业子会员</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t layui-form" id="frmEnterpriseSubmember">
                        <input type="hidden" name="enterpriseId" id="enterpriseId" value="${enterpriseId}">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">新增方式：</label>
                            <div class="col-sm-1">
                                <input type="radio" class="form-control" checked name="addType"
                                       lay-filter="addType" title="新增一个" value="0" checked>
                            </div>
                            <div class="col-sm-1">
                                <input type="radio" class="form-control" name="addType" lay-filter="addType"
                                       title="批量增加" value="1">
                            </div>
                        </div>
                        <div class="form-group row mobileDiv">
                            <label class="col-sm-3 col-form-label text-right">手机号：</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" id="mobile" name="mobile">
                            </div>
                            <div class="col-sm-1">
                                <button type="button" class="btn btn-success" id="sendVerificationCode"
                                        onclick="addEnterPriseMember.getAuthCode()">获取验证码
                                </button>
                            </div>
                        </div>

                        <div class="form-group row mobileDiv" >
                            <label class="col-sm-3 col-form-label text-right">验证码：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" autocomplete="off" id="verificationCode" name="verificationCode">
                            </div>
                        </div>

                        <div class="form-group row hide batchMobileDiv" >
                            <label class="col-sm-3 col-form-label text-right">手机号：</label>
                            <div class="col-sm-4">
                                <textarea type="text" style="height: 15%" class="form-control" id="batchMobile"
                                          name="batchMobile"></textarea>
                                <p>批量添加请用英文,分割</p>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    layui.use(['form', 'jquery', 'tree', 'laydate', 'util'], function () {

        var form = layui.form;
        var $ = layui.jquery;

        //上传与输入切换
        form.on("radio(addType)", function (data) {
            if ($(this).val() == "0") {
                $(".batchMobileDiv").addClass("hide");
                $(".mobileDiv").removeClass("hide");
            } else {
                $(".batchMobileDiv").removeClass("hide");
                $(".mobileDiv").addClass("hide");
            }
        });

    })


    addEnterPriseMember.init();
</script>
</body>
</html>
